package com.huawei123.hasee.cniao5store.di.component;

import android.app.Activity;
import android.content.Context;

import com.huawei123.hasee.cniao5store.di.module.FragmentModule;
import com.huawei123.hasee.cniao5store.di.scope.ContextLife;
import com.huawei123.hasee.cniao5store.di.scope.PerFragment;
import com.huawei123.hasee.cniao5store.mvp.view.fragment.AppIntroductionFragment;
import com.huawei123.hasee.cniao5store.mvp.view.fragment.AppManagerFragment;
import com.huawei123.hasee.cniao5store.mvp.view.fragment.CategoryFragment;
import com.huawei123.hasee.cniao5store.mvp.view.fragment.MyFragment;
import com.huawei123.hasee.cniao5store.mvp.view.fragment.RecommendFragment;
import com.huawei123.hasee.cniao5store.mvp.view.fragment.TopFragment;


import dagger.Component;

/**
 * 项目名称：Cniao5Store
 * 类描述：为Fragment提供的Component
 * 创建人：hasee
 * 创建时间：2017/11/9 21:18
 * 修改人：hasee
 * 修改时间：2017/11/9 21:18
 * 修改备注：注意因为需要Application的Context所以Component中需要依赖dependencies = AppComponent.class
 */
@PerFragment
@Component(modules = FragmentModule.class, dependencies = AppComponent.class)
public interface FragmentComponent {

    @ContextLife("Activity")
    Context getActivityContext();

    /**
     * 需要得到App Context，上边加上依赖dependencies = AppComponent.class
     *
     * @return
     */
    @ContextLife("Application")
    Context getApplicationContext();

    Activity getActivity();

    void inject(RecommendFragment fragment);

    void inject(CategoryFragment fragment);

    void inject(TopFragment fragment);

    void inject(AppManagerFragment fragment);

    void inject(MyFragment fragment);

    void inject(AppIntroductionFragment fragment);
}
